package com.lcy.struct.bTreePlus.disk.constants;

/**
 * @author lucongyang
 * @date Created in  22:16
 * @description
 */
public class BPlusPublicConstants {
    /**
     * 页大小
     * 单位byte
     */
    public static final int PAGE_SIZE = 100;
    /**
     * 数据的页信息链表
     * 每一链大小
     */
    public static final int PAGE_INFO_SIZE = 100;
    ///////////////////头部信息  ///////////////////
    /**
     * 头部信息总大小
     */
    public static final int ALL_HEAD_SIZE = 1000;
    /**
     * 头部信息大小
     */
    public static final int HEAD_SIZE = 20;
    /**
     * 总数信息地址
     */
    public static final long COUNT_POSITION_INFO_POSITION = 0;
    /**
     * 根节点的信息地址
     */
    public static final long ROOT_POSITION_INFO_POSITION = 20;
    /**
     * 末节点的信息地址
     */
    public static final long END_POSITION_INFO_POSITION = 40;
    /**
     * B+tree阶数信息
     */
    public static final long RANK_BPLUS_TREE_INFO_POSITION = 60;


    ///////////////////////////常量/////////////////////////////
    /**
     * 默认B+tree阶数
     */
    public static final Integer DEFAULT_RANK_BPLUS_TREE = 5;
    /**
     * 长整型指针分配的byte大小
     */
    public static final int POSITION_STR_SIZE = 20;

    //////////////////////redo log////////////////
    /**
     * redo log的末指针地址
     */
    public static final long REDO_END_POSITION = 0;
    /**
     * redo开始写前缀
     */
    public static final String REDO_START_STR = "REDO-START:";
    /**
     * redo写末后缀
     */
    public static final String REDO_END_STR = "DONE!";
    /**
     * redo做完标志
     * 放在
     *
     * @see BPlusPublicConstants.REDO_END_STR
     * 后
     */
    public static final String REDO_END_COMMIT_STR = "COMMIT!";
    /**
     * redo 内容前缀
     */
    public static final String REDO_CONTENT = "redo_content:";
    /**
     * redo 页大小
     * 务必大于100
     */
    public static final int REDO_PAGE_SIZE = 1000;
    ///////////////////////////// undo log /////////////////////////////
    /**
     * undo log的末指针地址
     */
    public static final long UNDO_END_POSITION = 0;
    /**
     * undo开始写前缀
     */
    public static final String UNDO_START_STR = "UNDO-START:";
    /**
     * undo做完标志
     * 放在
     *
     * @see BPlusPublicConstants.UNDO_END_STR
     * 后
     */
    public static final String UNDO_END_COMMIT_STR = "COMMIT!";
    /**
     * undo 内容前缀
     */
    public static final String UNDO_CONTENT = "undo_content:";
    /**
     * undo 未完结内容继续标志
     */
    public static final String UNDO_CONTENT_CONTINUE = "continue:";
    /**
     * undo 页大小
     * 务必大于100
     */
    public static final int UNDO_PAGE_SIZE = 100;
    ////////////////////////////// 事务 ///////////////////
    /**
     * 事务id长度最大
     */
    public static final int MAX_TRANSACTION_ID_LENGTH = 20;
}
